package cn.kgc.service.impl;

import cn.kgc.dao.UserDao;
import cn.kgc.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

/**
 * <bean id="userService" class="cn.kgc.service.impl.UserServiceImpl"></bean>
 *    @Component("userService")
 *  <property name="userDao" ref="userDao"></property>
 *      @Autowired :自动注入
 *      @Qualifier
 *      @Resource
 */
@Component("userService")
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;

    public void saveUser() {
        userDao.addUser();
    }
}
